package com.b2c.service;

import com.b2c.pojo.entity.AdminUser;
import com.b2c.pojo.vo.CodeEmailVo;
import com.b2c.pojo.vo.CodePhoneVO;
import com.b2c.pojo.vo.EmailVo;
import com.b2c.pojo.vo.PhoneVo;
import result.Result;
import com.baomidou.mybatisplus.extension.service.IService;
import freemarker.template.TemplateException;
import org.springframework.validation.annotation.Validated;

import javax.mail.MessagingException;
import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.io.IOException;

import static content.common.Regexp.PASSWORD_REGEXP;
import static content.common.ValidMessage.PASSWORD_FORMAT_ERROR;

/**
* @author Administrator
* @description 针对表【mall_admin_user】的数据库操作Service
* @createDate 2024-03-13 16:31:13
*/
@Validated
public interface AdminUserService extends IService<AdminUser> {

    Result adminLoginPhone(@Valid CodePhoneVO codePhoneVO );

    Result adminLoginSecret(@NotBlank String username, @Pattern(regexp = PASSWORD_REGEXP, message = PASSWORD_FORMAT_ERROR)  String password);

    Result updateSecret(@Pattern(regexp = PASSWORD_REGEXP, message = PASSWORD_FORMAT_ERROR) String password);

    Result bindPhone(@Valid CodePhoneVO codePhoneVO);

    Result setupSecret(@Pattern(regexp = PASSWORD_REGEXP, message = PASSWORD_FORMAT_ERROR) String password);


    Result registerByPhone(@Valid CodePhoneVO codePhoneVO);


    Result adminLoginEmail(@Valid CodeEmailVo codeEmailVo );

    Result registerByEmail(@Valid CodeEmailVo codeEmailVo);

    Result bindEmail(@Valid CodeEmailVo codeEmailVo);

    Result logout();
}
